package com.newly.common.base.entity.sys.auth.role.dto;

import com.newly.common.base.entity.sys.auth.entity.dto.EntityDto;
import com.newly.common.base.entity.valid.Insert;
import com.newly.common.base.entity.valid.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 角色视图数据
 */
@Data
public class RoleDto implements Serializable {
    /**
     * 角色id
     */
    @NotNull(message = "id can't be empty", groups = Update.class)
    @ApiModelProperty(value = "角色id")
    private Integer id;

    /**
     * 角色名称
     */
    @NotBlank(message = "name can't be empty", groups = {Insert.class})
    @ApiModelProperty(value = "角色名称")
    private String name;

    /**
     * 授权标识
     */
    @NotBlank(message = "auth can't be empty", groups = {Insert.class})
    @ApiModelProperty(value = "授权标识")
    private String auth;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 角色等级
     */
    @ApiModelProperty(value = "角色等级")
    private Integer level;

    /**
     * 角色类型
     */
    @ApiModelProperty(value = "角色类型")
    private Integer type;

    /**
     * 创建人
     */
    @ApiModelProperty("创建人")
    private Long createBy;

    /**
     * 父角色id，0代表顶级
     */
    @ApiModelProperty(value = "父角色id，0代表顶级")
    private Integer parentId;

    /**
     * 是否启用
     */
    @ApiModelProperty("是否启用")
    private Integer enable;

    /**
     * 权限实体
     */
    private List<EntityDto> permEntities;

    private static final long serialVersionUID = 1L;
}
